<?php
 namespace app\admin\service; use app\common\model\GoodsAttr; use app\common\model\GoodsAttrDel; use app\common\model\GoodsAttrModule; use app\common\model\GoodsAttrValue; use app\common\model\GoodsDeleted; use app\common\model\GoodsSku; use app\common\model\GoodsSkuDeleted; use app\common\model\GoodsSpec; use app\common\model\GoodsSpecFormat; use app\common\model\GoodsSpecValue; use app\common\model\GoodsSupplier; use think\Db; class Goods extends Base { function __construct() { parent::__construct(); $this->goods = new \app\common\model\Goods(); } public function getSupplierList($condition = '', $search_text) { $supplier = new GoodsSupplier(); return $supplier->getPageLisy($condition, $search_text); } public function getGoodsList($condition = '') { $list = $this->getGoodsViewQueryField($condition, "\52", ''); return $list; } public function ModifyGoodsOnline($condition) { goto gM5Ew; NUzw4: return UPDATA_FAIL; goto R28hi; gM5Ew: $data = array("\163\x74\x61\164\145" => 1, "\165\160\144\141\x74\x65\137\x74\x69\155\x65" => time()); goto ceIv9; vjHIV: return SUCCESS; goto mPqyU; ceIv9: $result = $this->goods->save($data, "\147\157\x6f\144\163\x5f\151\144\40\40\151\x6e\50{$condition}\x29"); goto fPxbT; fPxbT: if ($result > 0) { goto OBIkA; } goto NUzw4; R28hi: goto i7Htu; goto mzH_b; mzH_b: OBIkA: goto vjHIV; mPqyU: i7Htu: goto D6e4S; D6e4S: } public function deleteGoods($goods_id) { $this->goods->startTrans(); try { goto GtbU5; Wbi3x: $res = $this->goods->save($data, "\x67\x6f\157\x64\x73\x5f\x69\144\x20\40\x69\156\x28{$goods_id}\51"); goto jwmn_; fRZc7: goto ujhEG; goto efnF5; jwmn_: if ($res > 0) { goto b9tKI; } goto iioip; iioip: return DELETE_FAIL; goto fRZc7; GtbU5: $data = array("\x69\x73\x5f\x64\x65\x6c" => 1, "\165\160\x64\141\x74\x65\x5f\x74\151\x6d\x65" => time()); goto Wbi3x; efnF5: b9tKI: goto MLcbQ; MLcbQ: $this->goods->commit(); goto xjRER; M7Rcy: ujhEG: goto seH9f; xjRER: return SUCCESS; goto M7Rcy; seH9f: } catch (\Exception $e) { $this->goods->rollback(); return DELETE_FAIL; } } private function addGoodsDeleted($goods_ids) { $this->goods->startTrans(); try { goto XYXLk; vGlKb: CsiLP: goto IcLfX; NGWoE: foreach ($goods_id_array as $k => $v) { goto APikv; bGtQi: $goods_info = json_decode(json_encode($goods_info), true); goto o2hwV; wN_Yq: $goods_sku_list = $goods_sku_model->getQuerys(["\x67\157\157\144\163\137\151\x64" => $v], "\52", ''); goto mDJ5l; Ncx4X: jc631: goto gWJRb; WXF47: $goods_sku_model = new GoodsSku(); goto wN_Yq; LgcDN: if (!empty($goods_delete_obj)) { goto jc631; } goto IwQHf; jvtQU: $goods_attribute_model = new GoodsAttr(); goto uct1P; mb2us: $goods_delete_model->save($goods_info); goto WXF47; Pra8j: $goods_delete_model = new GoodsDeleted(); goto bGtQi; dL05v: foreach ($goods_attribute_list as $goods_attribute_obj) { goto EWfwA; zHEfL: $goods_attribute_obj = json_decode(json_encode($goods_attribute_obj), true); goto SW4rx; EWfwA: $goods_attribute_delete_model = new GoodsAttrDel(); goto zHEfL; SW4rx: $goods_attribute_delete_model->save($goods_attribute_obj); goto xS2bP; xS2bP: yIYCC: goto QS72_; QS72_: } goto ZvIBF; o2hwV: $goods_delete_obj = $goods_delete_model->getInfo(["\147\x6f\157\x64\x73\137\151\144" => $v]); goto LgcDN; uct1P: $goods_attribute_list = $goods_attribute_model->getQuerys(["\x67\157\157\144\x73\137\151\x64" => $v], "\x2a", ''); goto dL05v; IwQHf: $goods_info["\165\160\144\141\164\x65\x5f\164\151\x6d\x65"] = time(); goto mb2us; APikv: $goods_info = $this->goods->get($v); goto Pra8j; gWJRb: g1WcZ: goto dKiOV; ZvIBF: bPdpA: goto Ncx4X; mDJ5l: foreach ($goods_sku_list as $goods_sku_obj) { goto LNAQq; DCdEA: UVQVI: goto IllSt; WSFse: $goods_sku_obj = json_decode(json_encode($goods_sku_obj), true); goto Ch39z; LNAQq: $goods_sku_deleted_model = new GoodsSkuDeleted(); goto WSFse; af1sj: $goods_sku_deleted_model->save($goods_sku_obj); goto DCdEA; Ch39z: $goods_sku_obj["\x75\160\x64\x61\164\145\x5f\144\141\x74\x65"] = time(); goto af1sj; IllSt: } goto W9uUZ; W9uUZ: QifJK: goto jvtQU; dKiOV: } goto vGlKb; IcLfX: $this->goods->commit(); goto ttXKQ; XYXLk: $goods_id_array = explode("\x2c", $goods_ids); goto NGWoE; ttXKQ: return 1; goto Hw8yG; Hw8yG: } catch (\Exception $e) { $this->goods->rollback(); return $e->getMessage(); } } public function ModifyGoodsOffline($condition) { goto aLdza; aLdza: $data = array("\163\x74\141\x74\x65" => 0, "\x75\x70\144\141\x74\x65\x5f\x74\x69\x6d\145" => time()); goto WykYG; UmMmC: return SUCCESS; goto Ot0Ch; Dm0cX: SYVa8: goto UmMmC; aLm2n: return UPDATA_FAIL; goto qDguk; qDguk: goto FREjB; goto Dm0cX; WykYG: $result = $this->goods->save($data, "\x67\157\157\144\x73\x5f\x69\x64\x20\40\x69\156\x28{$condition}\x29"); goto prs87; prs87: if ($result > 0) { goto SYVa8; } goto aLm2n; Ot0Ch: FREjB: goto URCB5; URCB5: } public function getGoodsViewQueryField($condition, $field, $order = '') { goto TIFEH; W1cF0: $list = $goods_view->alias("\156\x67")->join("\171\x62\x73\x63\x5f\151\x6d\x61\x67\x65\x73\40\151\x6d\141\x67\145\x73", "\x6e\x67\56\x69\x6d\141\x67\145\163\x20\75\x20\x69\155\x61\x67\145\163\x2e\x69\x6d\x67\137\x69\x64", "\x6c\x65\146\x74")->order("\x6e\x67\56\163\157\162\x74\x20\x64\x65\x73\143\54\156\147\56\x63\162\x65\x61\x74\145\x5f\x74\151\x6d\145\x20\144\x65\163\143")->field($field)->where($condition)->paginate(20, false, ["\x71\x75\145\x72\171" => ["\163" => $url]]); goto V2qni; V2qni: return $list; goto S6ZDd; TIFEH: $url = request()->query(); goto vd2BZ; HvmUA: $goods_view = new \app\common\model\Goods(); goto W1cF0; N4G0w: $url = "\x2f" . $url[0]; goto HvmUA; vd2BZ: $url = explode("\x3d\x2f", $url); goto uQbUN; uQbUN: $url = explode("\x26\x70\141\147\145", $url[1]); goto N4G0w; S6ZDd: } public function addSupplier($supplier_name, $name, $tel, $address, $info, $logo, $mch_id) { goto HyNwJ; hTm3T: return $res; goto zIBcL; nhf78: $res = $supplier->save($data); goto hTm3T; HyNwJ: $supplier = new GoodsSupplier(); goto LNt5G; LNt5G: $data = array("\x73\165\160\160\x6c\x69\145\162\137\x6e\141\x6d\x65" => $supplier_name, "\156\x61\x6d\x65" => $name, "\164\x65\154" => $tel, "\x61\144\x64\x72\x65\x73\x73" => $address, "\x69\156\x66\157" => $info, "\x6c\x6f\147\157" => $logo, "\143\x72\x65\x61\164\145\x5f\x74\x69\x6d\145" => time(), "\x6d\143\x68\x5f\x69\x64" => $mch_id); goto nhf78; zIBcL: } public function updateSupplier($supplier_id, $supplier_name, $name, $tel, $address, $info, $logo, $bus_id) { goto Z4KDg; yegFM: $data = array("\x73\x75\160\160\x6c\151\x65\162\x5f\156\x61\x6d\x65" => $supplier_name, "\x6e\141\x6d\x65" => $name, "\164\x65\154" => $tel, "\x61\144\144\x72\x65\163\163" => $address, "\x69\x6e\x66\x6f" => $info, "\x6c\157\x67\x6f" => $logo, "\155\143\150\137\x69\144" => $bus_id); goto JOExf; JOExf: return $supplier->save($data, ["\x73\165\160\160\154\151\x65\162\137\x69\x64" => $supplier_id]); goto NxPad; Z4KDg: $supplier = new GoodsSupplier(); goto yegFM; NxPad: } public function getSupplierInfo($supplier_id) { $supplier = new GoodsSupplier(); return $supplier->get($supplier_id); } public function deleteSupplier($supplier_id_array) { goto B6RQ9; T4e3V: return $res; goto iDbY1; B6RQ9: $supplier = new GoodsSupplier(); goto nf4EX; nf4EX: $res = $supplier->destroy($supplier_id_array); goto T4e3V; iDbY1: } protected function checkSupplierIsUse($supplier_id) { goto x_kUc; jTKB0: $count = $goods->getCount(["\163\x75\160\160\154\151\x65\x72\x5f\x69\x64" => $supplier_id]); goto RnnBj; RnnBj: $count += $goods_deleted->getCount(["\163\x75\x70\160\x6c\151\145\162\x5f\x69\144" => $supplier_id]); goto QmSiH; QmSiH: return $count; goto Bvjdo; OJqKZ: $goods_deleted = new GoodsDeleted(); goto jTKB0; x_kUc: $goods = new \app\common\model\Goods(); goto OJqKZ; Bvjdo: } public function addGoodsSpecService($spec_name, $show_type, $is_visible, $sort, $spec_value_str, $attr_id = 0, $is_screen, $cate_id, $mch_id) { goto J8O7L; Tejjo: $goods_spec->startTrans(); goto TBKM1; TBKM1: try { goto SruBa; AlHib: foreach ($spec_value_array as $k => $v) { goto ozRHX; UhM_u: tU6FB: goto SBwUW; Avixl: $spec_value = explode("\x3a", $v); goto VESDo; m4VbJ: goto N55A1; goto kxcv1; jDSk1: N55A1: goto UhM_u; VESDo: $this->addGoodsSpecValueService($spec_id, $spec_value[0], 1, 255); goto jDSk1; tQCbM: if ($show_type == 2) { goto rFKxq; } goto k0ccM; k0ccM: $this->addGoodsSpecValueService($spec_id, $v, 1, 255); goto m4VbJ; kxcv1: rFKxq: goto Avixl; ozRHX: $spec_value = array(); goto tQCbM; SBwUW: } goto dI0dC; dI0dC: zAN5s: goto jR7Tu; VkNvA: qVqrY: goto UxnTM; jR7Tu: $goods_spec->commit(); goto Fu6p_; nKYPB: $spec_value_array = explode("\x2c", $spec_value_str); goto ocRC3; YnoTs: $attribute->save(["\163\160\x65\x63\137\x69\x64\x5f\141\x72\x72\x61\x79" => $attribute_info["\x73\160\x65\143\137\x69\x64\137\141\162\x72\141\171"] . "\x2c" . $spec_id], ["\141\164\x74\x72\x5f\x69\144" => $attr_id]); goto QZ_uA; lLRcR: $spec_id = $goods_spec->spec_id; goto u2rRl; ghM8o: maAyb: goto nKYPB; ocRC3: $spec_value_array = array_filter($spec_value_array); goto mM248; Fu6p_: return $spec_id; goto OU3kc; p2Ogw: if ($attribute_info["\x73\160\145\143\x5f\x69\144\137\141\162\x72\141\171"] == '') { goto qVqrY; } goto YnoTs; pcsS6: zRyiB: goto ghM8o; SruBa: $data = array("\163\160\145\x63\x5f\x6e\x61\x6d\145" => $spec_name, "\x73\x68\x6f\x77\137\x74\x79\160\x65" => 0, "\151\x73\x5f\x76\x69\x73\151\142\154\x65" => $is_visible, "\x73\157\162\x74" => $sort, "\143\x72\x65\x61\164\x65\x5f\164\151\x6d\145" => time(), "\143\141\164\145\137\x69\x64" => $cate_id, "\155\x63\x68\x5f\151\144" => $mch_id); goto vTHg3; QZ_uA: goto zRyiB; goto VkNvA; u2rRl: if (!($attr_id > 0)) { goto maAyb; } goto OLr2_; OLr2_: $attribute = new GoodsAttrModule(); goto G2l7M; UxnTM: $attribute->save(["\163\x70\145\x63\137\x69\x64\x5f\141\162\x72\x61\x79" => $spec_id], ["\x61\x74\x74\162\x5f\x69\x64" => $attr_id]); goto pcsS6; mM248: $spec_value_array = array_unique($spec_value_array); goto AlHib; vTHg3: $goods_spec->save($data); goto lLRcR; G2l7M: $attribute_info = $attribute->getInfo(["\141\164\164\162\137\151\144" => $attr_id], "\x2a"); goto p2Ogw; OU3kc: } catch (\Exception $e) { goto VKzhW; dn0Y2: dump($e->getMessage()); goto CS82w; CS82w: return $e->getMessage(); goto lCCVE; VKzhW: $goods_spec->rollback(); goto dn0Y2; lCCVE: } goto sMtkS; J8O7L: $goods_spec = new GoodsSpec(); goto Tejjo; sMtkS: } public function addGoodsSpecValueService($spec_id, $spec_value_name, $is_visible, $sort = "\x30") { goto gTCFP; Muf6_: return $goods_spec_value->spec_value_id; goto VlLD2; gTCFP: $goods_spec_value = new GoodsSpecValue(); goto Km2Ln; Km2Ln: $data = array("\163\160\x65\143\137\x69\x64" => $spec_id, "\163\160\145\143\137\x76\x61\x6c\165\x65\137\x6e\141\155\145" => $spec_value_name, "\x69\x73\x5f\x76\x69\x73\151\x62\154\145" => $is_visible, "\163\157\x72\x74" => $sort, "\143\162\145\141\164\145\137\164\151\x6d\x65" => time()); goto OYnnQ; OYnnQ: $goods_spec_value->save($data); goto Muf6_; VlLD2: } public function getGoodsSpecList($condition = '', $search_text) { goto imWHG; Aa2bn: RHDSL: goto Oqx3v; Oqx3v: fUqef: goto PllFf; PllFf: return $goods_spec_list; goto H__CN; IsNvD: if (empty($goods_spec_list)) { goto fUqef; } goto zvKIk; fUJRw: $goods_spec_list = $goods_spec->getPageLisy($condition, $search_text); goto IsNvD; imWHG: $goods_spec = new GoodsSpec(); goto fJv3n; zvKIk: foreach ($goods_spec_list as $ks => $vs) { goto lnf_J; oW7ci: $goods_spec_list[$ks]["\x73\160\145\143\x5f\166\141\154\x75\x65\137\154\x69\163\164"] = $spec_value_list; goto hca8V; FH5hI: $goods_spec_list[$ks]["\163\x70\x65\x63\x5f\166\141\x6c\x75\x65\x5f\156\141\155\x65\137\x6c\x69\x73\x74"] = $goods_spec_value_name; goto ub9cf; Txjzm: $spec_value_list = $goods_spec_value->getQuerys(["\163\x70\x65\143\x5f\151\x64" => $vs["\163\x70\x65\x63\137\x69\x64"]], "\52", ''); goto GM1VE; GM1VE: foreach ($spec_value_list as $kv => $vv) { $goods_spec_value_name = $goods_spec_value_name . "\x2c" . $vv["\x73\160\x65\143\137\x76\x61\x6c\x75\145\137\156\x61\x6d\x65"]; NiJ2P: } goto Wvx5s; hca8V: $goods_spec_value_name = $goods_spec_value_name == '' ? '' : substr($goods_spec_value_name, 1); goto FH5hI; ub9cf: zl_tR: goto sVvzH; lnf_J: $goods_spec_value_name = ''; goto Txjzm; Wvx5s: F38s5: goto oW7ci; sVvzH: } goto Aa2bn; fJv3n: $goods_spec_value = new GoodsSpecValue(); goto fUJRw; H__CN: } public function getGoodsSpecAll($condition = '', $field = "\52", $order = '') { goto XXtsB; b4Xyx: Fce7G: goto qMktc; BekiN: foreach ($goods_spec_list as $ks => $vs) { goto BIk_R; Z0Le_: HpsCn: goto NVmGV; BIk_R: $goods_spec_value_name = ''; goto ygb2u; Zgu3d: foreach ($spec_value_list as $kv => $vv) { $goods_spec_value_name = $goods_spec_value_name . "\54" . $vv["\163\160\145\143\x5f\166\141\154\165\145\137\156\x61\155\x65"]; K3JFh: } goto Z0Le_; BqrFz: n0sbT: goto mVSUR; NVmGV: $goods_spec_list[$ks]["\163\160\x65\x63\137\x76\141\154\165\145\137\x6c\x69\x73\x74"] = $spec_value_list; goto i7hVx; qtf1k: $goods_spec_list[$ks]["\163\160\145\143\x5f\x76\141\x6c\x75\145\137\156\141\x6d\145\x5f\154\x69\x73\164"] = $goods_spec_value_name; goto BqrFz; ygb2u: $spec_value_list = $goods_spec_value->getQuerys(["\163\x70\x65\143\137\151\x64" => $vs["\163\x70\145\x63\x5f\151\144"]], "\x2a", ''); goto Zgu3d; i7hVx: $goods_spec_value_name = $goods_spec_value_name == '' ? '' : substr($goods_spec_value_name, 1); goto qtf1k; mVSUR: } goto eL1YJ; NP5lA: $goods_spec_list = $goods_spec->getQuerys($condition, $field, $order); goto s7rsU; XXtsB: $goods_spec = new GoodsSpec(); goto YPOjR; YPOjR: $goods_spec_value = new GoodsSpecValue(); goto NP5lA; eL1YJ: QvtTA: goto b4Xyx; qMktc: return $goods_spec_list; goto uMW2Z; s7rsU: if (empty($goods_spec_list)) { goto Fce7G; } goto BekiN; uMW2Z: } public function getAttrValueAll($condition = '', $field = "\x2a", $order = '') { goto h3m2Z; oDfWX: return $attr_value_list; goto QK0Jw; x1ydd: $attr_value_list = $attr_value->getQuerys($condition, $field, $order); goto oDfWX; h3m2Z: $attr_value = new GoodsAttrValue(); goto x1ydd; QK0Jw: } public function getGoodsSpecDetail($spec_id) { goto aUSWl; hDoEc: $info = $goods_spec->getInfo(["\x73\160\145\x63\137\x69\144" => $spec_id], "\x2a"); goto RSp0y; ZAIUe: XFLCP: goto rBB19; RSp0y: $goods_spec_value_name = ''; goto oPTW6; sJTyY: foreach ($spec_value_list as $kv => $vv) { $goods_spec_value_name = $goods_spec_value_name . "\54" . $vv["\163\x70\145\143\x5f\x76\141\x6c\165\x65\137\156\x61\x6d\x65"]; HqttS: } goto ZAIUe; FmPcx: $goods_spec_value = new GoodsSpecValue(); goto hDoEc; gz07Z: $info["\163\x70\145\143\137\166\x61\x6c\x75\145\137\154\x69\163\164"] = $spec_value_list; goto GS_oB; aUSWl: $goods_spec = new GoodsSpec(); goto FmPcx; GS_oB: return $info; goto NchiX; rBB19: klPry: goto x30ja; TK5FT: $goods_spec_value->destroy(["\163\160\x65\143\x5f\x69\x64" => $info["\x73\x70\145\143\x5f\x69\144"], "\x73\x70\145\x63\137\x76\141\154\x75\145\137\x6e\141\155\x65" => '']); goto Zqr__; oPTW6: if (empty($info)) { goto klPry; } goto TK5FT; Zqr__: $spec_value_list = $goods_spec_value->getQuerys(["\163\160\x65\143\137\x69\x64" => $info["\x73\x70\x65\x63\137\151\x64"]], "\x2a", ''); goto sJTyY; x30ja: $info["\x73\x70\x65\143\137\166\x61\154\x75\145\137\x6e\x61\155\x65\x5f\154\151\163\x74"] = substr($goods_spec_value_name, 1); goto gz07Z; NchiX: } public function updateGoodsSpecService($spec_id, $spec_name, $is_visible, $sort, $spec_value_str, $cate_id, $bus_id) { goto XW8Zl; nOVuP: $goods_spec->startTrans(); goto lfnBl; lfnBl: try { goto XJ86t; ELh3B: $spec_value_array = explode("\x2c", $spec_value_str); goto aigNv; hQhE_: AnY4m: goto PLOO2; U_7l6: return $res; goto fAY5d; qM2wp: $res = $goods_spec->save($data, ["\x73\x70\145\x63\137\151\x64" => $spec_id]); goto iSFfg; aigNv: $spec_value_array = array_filter($spec_value_array); goto ebhyE; mdR7C: foreach ($spec_value_array as $k => $v) { $this->addGoodsSpecValueService($spec_id, $v, 1, 255); xUKed: } goto Uu5zS; Uu5zS: U0XcK: goto hQhE_; XJ86t: $data = array("\163\160\145\x63\137\x6e\141\155\145" => $spec_name, "\151\x73\137\166\151\163\151\x62\x6c\145" => $is_visible, "\163\157\162\x74" => $sort, "\x63\x61\x74\145\137\x69\x64" => $cate_id, "\x6d\x63\x68\137\151\144" => $bus_id); goto qM2wp; ebhyE: $spec_value_array = array_unique($spec_value_array); goto mdR7C; PLOO2: $goods_spec->commit(); goto U_7l6; iSFfg: if (empty($spec_value_str)) { goto AnY4m; } goto ELh3B; fAY5d: } catch (\Exception $e) { $goods_spec->rollback(); return $e->getMessage(); } goto RlbOA; XW8Zl: $goods_spec = new GoodsSpec(); goto nOVuP; RlbOA: } public function addAttrModule($attr_mod_id, $attr_name, $spec_id, $attr_value_id, $is_use, $sort, $mch_id) { goto RpH4C; RpH4C: $attr_module = new GoodsAttrModule(); goto amx2G; amx2G: $attr_module->startTrans(); goto ecsHs; ecsHs: try { goto Mohrm; Mohrm: $data = array("\141\164\x74\162\137\156\x61\x6d\145" => $attr_name, "\151\163\x5f\x75\163\x65" => $is_use, "\163\157\x72\x74" => $sort, "\163\160\x65\143\x5f\x69\144\137\x61\x72\162\x61\x79" => $spec_id, "\141\x74\x74\x72\x5f\x76\x61\x6c\165\145\137\x69\144" => $attr_value_id, "\x63\x72\x65\x61\x74\145\x5f\x74\151\x6d\x65" => time(), "\x6d\143\x68\x5f\x69\x64" => $mch_id); goto hJtsL; emfVx: HtmRR: goto R0AvC; hJtsL: if ($attr_mod_id == 0) { goto euQvM; } goto ocTY2; WHf5o: $values = array("\141\164\x74\x72\137\x69\144" => $attr_module_id); goto emfVx; KuJf_: euQvM: goto F0woN; Co4gP: return $attr_module_id; goto FaYSE; F0woN: $attr_module->save($data); goto n1bSd; fFWe2: goto HtmRR; goto KuJf_; n1bSd: $attr_module_id = $attr_module->attr_id; goto WHf5o; R0AvC: $attr_module->commit(); goto Co4gP; ocTY2: $attr_module->save($data, ["\x61\x74\x74\162\x5f\x69\144" => $attr_mod_id]); goto hQ1IU; hQ1IU: $attr_module_id = $attr_mod_id; goto fFWe2; FaYSE: } catch (\Exception $e) { $attr_module->rollback(); return $e->getMessage(); } goto PEN0_; PEN0_: } public function modifyGoodsSpecValueField($spec_value_id, $field_name, $field_value) { $goods_spec_value = new GoodsSpecValue(); return $goods_spec_value->save(["{$field_name}" => $field_value], ["\x73\160\x65\x63\137\166\x61\x6c\x75\x65\137\x69\x64" => $spec_value_id]); } public function deleteGoodsSpecValue($spec_id, $spec_value_id) { goto I3sHH; I3sHH: $result = $this->getGoodsSpecValueCount(["\163\160\145\x63\137\x69\144" => $spec_id]); goto CgRzC; o7Yk0: $goods_spec_value = new GoodsSpecValue(); goto dLDCT; G_p2N: return -2; goto Zqb1k; CgRzC: if ($result == 1) { goto vj19U; } goto o7Yk0; BNzLn: goto RAqsH; goto AU2bn; dLDCT: return $goods_spec_value->destroy($spec_value_id); goto BNzLn; AU2bn: vj19U: goto G_p2N; Zqb1k: RAqsH: goto S1tay; S1tay: } public function getGoodsSpecValueCount($condition) { goto HW5IS; HW5IS: $spec_value = new GoodsSpecValue(); goto MxcTk; MxcTk: $count = $spec_value->where($condition)->count(); goto y_clt; y_clt: return $count; goto I_ti1; I_ti1: } public function checkGoodsSpecValueIsUse($spec_id, $spec_value_id) { goto KfgMn; QBUBW: return false; goto E3nrX; H73SK: $res = $goods_sku->where("\x20\103\117\116\103\101\x54\50\141\x74\164\162\x5f\x76\141\154\165\x65\137\x69\x74\145\x6d\163\54\40\x27\x3b\47\x29\40\154\151\153\145\x20\47\x25" . $check_str . "\x25\47")->count(); goto h1j2j; tNcJx: jXduh: goto JQhiD; Zk3_c: $goods_sku = new GoodsSku(); goto ZUK0F; RScK2: BcbsV: goto r74f_; zs33p: if ($res + $res_delete > 0) { goto jXduh; } goto QBUBW; E3nrX: goto BcbsV; goto tNcJx; JQhiD: return true; goto RScK2; ZUK0F: $goods_sku_delete = new GoodsSkuDeleted(); goto H73SK; h1j2j: $res_delete = $goods_sku_delete->where("\x20\x43\x4f\116\x43\x41\124\50\141\x74\x74\x72\x5f\x76\x61\x6c\x75\145\x5f\x69\x74\x65\x6d\x73\54\40\x27\73\x27\x29\40\154\x69\x6b\145\40\47\x25" . $check_str . "\x25\x27")->count(); goto zs33p; KfgMn: $check_str = $spec_id . "\x3a" . $spec_value_id . "\x3b"; goto Zk3_c; r74f_: } public function modifyGoodsSpecField($spec_id, $field_name, $field_value) { goto EMA52; WCF5f: return $res; goto kuGxE; k6C3R: $res = $goods_spec->save($data, ["\163\160\145\143\x5f\x69\x64" => $spec_id]); goto WCF5f; EMA52: $goods_spec = new GoodsSpec(); goto vQeKp; vQeKp: $data = array("{$field_name}" => $field_value); goto k6C3R; kuGxE: } public function modifyAttributeFieldService($attr_id, $field_name, $field_value) { $attribute = new GoodsAttrValue(); return $attribute->save(["{$field_name}" => $field_value], ["\x61\x74\x74\x72\137\x76\x61\154\165\145\137\x69\x64" => $attr_id]); } public function getAttrModuleInfo($mod_id, $condition = '', $field = "\x2a", $order = '') { goto XVNaP; oDbOC: if (!(!empty($attr_mod_list["\141\164\x74\x72\x5f\166\x61\x6c\x75\x65\x5f\151\144"]) && $attr_mod_list["\x61\x74\164\162\137\x76\141\x6c\x75\145\137\x69\x64"] == '')) { goto VfvIf; } goto KpspV; qD7di: $attr_mod_list = $attr_mod->getInfo($where); goto mOkW2; ORoPR: $where["\141\164\x74\162\137\x69\x64"] = array("\145\161", $mod_id); goto qD7di; TZlyC: VfvIf: goto piMZ8; XVNaP: $attr_mod = new GoodsAttrModule(); goto ORoPR; KpspV: $condition["\141\164\164\162\x5f\166\141\154\165\x65\x5f\151\144"] = array("\x69\156", $attr_mod_list["\141\164\x74\x72\x5f\166\x61\154\x75\x65\137\x69\x64"]); goto TZlyC; QHzQ6: $attr_val = new GoodsAttrValue(); goto oDbOC; LdjAg: $attr_mod_list["\163\160\x65\143\x5f\x69\144\137\141\x72\x72\x61\171"] = $spec_id_array; goto QHzQ6; xiQAX: $attr_mod_list["\x61\164\x74\162\x5f\166\141\154\165\x65\163"] = $attr_val_list; goto wi5b2; mOkW2: $spec_id_array = explode("\54", $attr_mod_list["\x73\x70\x65\x63\x5f\x69\x64\x5f\x61\162\162\x61\171"]); goto LdjAg; piMZ8: $attr_val_list = $attr_val->getQuerys($condition, $field, $order); goto xiQAX; wi5b2: return $attr_mod_list; goto vCKhi; vCKhi: } public function deleteGoodsSpec($spec_id) { goto bDIyK; SXZhk: try { goto fQiyL; BKk5D: Y8H3L: goto duJT8; fQiyL: $spec_id_array = explode("\x2c", $spec_id); goto IRDBh; IRDBh: foreach ($spec_id_array as $k => $v) { goto hEmf1; wlHWL: goto S8UWj; goto Z1gPM; Z1gPM: k3yMh: goto WEiDY; WEiDY: return -1; goto tDztz; nyw5v: $spec_value->destroy(["\x73\x70\x65\143\137\151\144" => $v]); goto wlHWL; WQKBZ: DqXzs: goto fcw42; qTfm0: $goods_spec->destroy($v); goto nyw5v; Os_yk: if ($res) { goto k3yMh; } goto qTfm0; hEmf1: $res = $this->checkGoodsSpecIsUse($v); goto Os_yk; AjRiT: S8UWj: goto WQKBZ; tDztz: $goods_spec->rollback(); goto AjRiT; fcw42: } goto BKk5D; IR1kr: return 1; goto Mb1rt; duJT8: $goods_spec->commit(); goto IR1kr; Mb1rt: } catch (\Exception $e) { $goods_spec->rollback(); return $e->getMessage(); } goto NkqfB; bDIyK: $goods_spec = new GoodsSpec(); goto pe_nO; A8GUM: $goods_spec->startTrans(); goto SXZhk; pe_nO: $spec_value = new GoodsSpecValue(); goto A8GUM; NkqfB: } public function checkGoodsSpecIsUse($spec_id) { goto eKlD5; tczD2: OqsaW: goto GDK_a; kN9UR: goto OqsaW; goto vEmL2; AYm6b: $goods_sku = new GoodsSku(); goto mwgQk; mwgQk: $spec_value_list = $goods_spec_value->getQuerys(["\x73\x70\145\143\137\x69\144" => $spec_id], "\x2a", ''); goto RTfvL; jvUuf: $check_str = ''; goto ctRuR; ctRuR: $res = 0; goto PO6i2; RuRXP: jtF4j: goto MVAd3; OFMZm: return false; goto kN9UR; RTfvL: if (!empty($spec_value_list)) { goto Npsah; } goto OFMZm; MVAd3: if (!($res == 0)) { goto Ja37v; } goto dt03O; eKlD5: $goods_spec_value = new GoodsSpecValue(); goto AYm6b; vEmL2: Npsah: goto jvUuf; PO6i2: foreach ($spec_value_list as $k => $v) { goto lVBom; baQoY: if (!($res > 0)) { goto B8f3I; } goto ZX1l_; ZX1l_: return true; goto e104G; ysBJk: $res += $goods_sku->where("\x20\x43\117\116\x43\x41\x54\50\x61\x74\164\x72\137\166\x61\154\165\x65\137\x69\164\x65\155\163\54\x20\x27\x3b\47\x29\40\x6c\151\153\x65\x20\x27\45" . $check_str . "\x25\47")->count(); goto baQoY; w4rue: yh27O: goto Nz5mZ; fqmTg: B8f3I: goto w4rue; lVBom: $check_str = $spec_id . "\72" . $v["\x73\x70\x65\143\x5f\x76\141\154\x75\x65\137\151\x64"] . "\73"; goto ysBJk; e104G: goto jtF4j; goto fqmTg; Nz5mZ: } goto RuRXP; E1d_E: Ja37v: goto tczD2; dt03O: return false; goto E1d_E; GDK_a: } public function addAttributeService($attr_name, $is_use, $sort, $value_string, $cate_id, $mch_id) { goto ZzZjm; rt6ID: $attribute->startTrans(); goto U41GZ; U41GZ: try { goto Qo_83; fpuVh: $attr_value_id = $attribute->attr_value_id; goto w9itk; sqypQ: return $attr_value_id; goto ycWSy; vV6iS: $attribute->save($data); goto fpuVh; w9itk: $attribute->commit(); goto sqypQ; Qo_83: $data = array("\x61\x74\164\x72\137\166\141\154\165\145\137\156\141\155\x65" => $attr_name, "\151\163\137\x75\163\x65" => $is_use, "\x73\157\x72\164" => $sort, "\141\164\164\162\x5f\151\x64" => 0, "\x76\x61\x6c\x75\x65" => $value_string, "\143\x61\x74\145\137\x69\144" => $cate_id, "\155\143\150\137\151\x64" => $mch_id); goto vV6iS; ycWSy: } catch (\Exception $e) { $attribute->rollback(); return $e->getMessage(); } goto FBy6T; ZzZjm: $attribute = new GoodsAttrValue(); goto rt6ID; FBy6T: } public function updateAttributeService($attr_id, $attr_name, $is_use, $attr_value_str, $sort, $cate_id) { goto J5VtW; J5VtW: $attribute = new GoodsAttrValue(); goto ROJiT; ROJiT: $attribute->startTrans(); goto cXMP5; cXMP5: try { goto GIKL_; YMSp7: $res = $attribute->save($data, ["\x61\164\164\x72\x5f\166\141\x6c\165\x65\x5f\151\144" => $attr_id]); goto PVdk6; PVdk6: $attribute->commit(); goto S7oq7; GIKL_: $data = array("\141\164\164\x72\x5f\x76\141\154\x75\x65\137\x6e\141\x6d\145" => $attr_name, "\x69\163\x5f\165\163\x65" => $is_use, "\166\x61\x6c\165\145" => $attr_value_str, "\x73\x6f\162\164" => $sort, "\143\141\x74\x65\137\x69\x64" => $cate_id); goto YMSp7; S7oq7: return $res; goto TRf39; TRf39: } catch (\Exception $e) { $attribute->rollback(); return $e->getMessage(); } goto nZ3Hq; nZ3Hq: } public function addAttributeValueService($attr_id, $attr_value_name, $sort, $value) { goto clQKL; VoA7L: return $attribute_value->attr_value_id; goto sc053; GbEpn: $attribute_value->save($data); goto VoA7L; ornKi: $data = array("\x61\164\164\x72\137\x69\x64" => $attr_id, "\141\164\x74\x72\x5f\x76\141\x6c\x75\x65\x5f\156\x61\x6d\145" => $attr_value_name, "\164\x79\x70\145" => 3, "\x73\157\x72\164" => $sort, "\166\141\154\x75\145" => $value); goto GbEpn; clQKL: $attribute_value = new GoodsAttrValue(); goto ornKi; sc053: } public function getAttributeModServiceList($condition = '', $field = "\x2a", $order = '') { goto jZLfF; jZLfF: $attribute = new GoodsAttrModule(); goto ilgc2; oaJKT: foreach ($list as $k => $v) { goto HSDXY; cAdn8: $value_str = ''; goto lNRVW; pda31: $list[$k]["\166\x61\154\x75\145\x5f\163\164\162"] = $value_str; goto bOYVR; bOYVR: VgRkO: goto Dy2N7; j8Ha9: oKj3g: goto zMz6p; HSDXY: $new_array = $attribute_value->getQuerys(["\141\x74\164\162\x5f\151\x64" => $v["\141\164\x74\162\x5f\151\x64"]], "\x61\x74\164\x72\x5f\x76\141\x6c\x75\x65\137\156\x61\155\x65", ''); goto cAdn8; zMz6p: $value_str = substr($value_str, 1); goto pda31; lNRVW: foreach ($new_array as $kn => $vn) { $value_str = $value_str . "\54" . $vn["\x61\164\164\x72\137\x76\x61\x6c\165\145\137\156\141\x6d\x65"]; xOb7A: } goto j8Ha9; Dy2N7: } goto Zm6n1; oBsZJ: return $list; goto j8qaK; ilgc2: $attribute_value = new GoodsAttrValue(); goto aeC_f; Zm6n1: GiYMm: goto Kve5s; CNr31: if (empty($list)) { goto x3chp; } goto oaJKT; Kve5s: x3chp: goto oBsZJ; aeC_f: $list = $attribute->getQuerys($condition, $field, $order); goto CNr31; j8qaK: } public function getAttributeServiceList($condition = '', $search_text = '') { goto x_RBm; fOKdV: return $list; goto Qil5n; eqoUk: $list = $attribute_value->getPageLisy($condition, $search_text); goto fOKdV; x_RBm: $attribute_value = new GoodsAttrValue(); goto eqoUk; Qil5n: } public function getAttributeServiceAll($condition = '', $field = "\52", $order = '') { goto UM4cg; T7J5z: $list = $attribute_value->getQuerys($condition, $field, $order); goto q3DGz; q3DGz: return $list; goto EgdCr; UM4cg: $attribute_value = new GoodsAttrValue(); goto T7J5z; EgdCr: } public function getAttributeServiceListSelect($condition = '', $search_text = '', $order = '') { goto Imrsu; DL8JN: foreach ($list as $k => $v) { goto uA7Ok; RDFxb: $spec_str = ''; goto cId3H; uA7Ok: $spec_value_array = explode("\54", $v["\x73\x70\145\143\137\151\144\x5f\141\162\x72\141\171"]); goto RDFxb; ZOn3V: ty8q8: goto IsG8B; V6Kfi: yqBpd: goto lfYr9; Mq0XH: $list[$k]["\x73\160\x65\143\x5f\x76\141\x6c\165\x65\x5f\163\x74\162"] = $spec_str; goto V6Kfi; cId3H: foreach ($spec_value_array as $key => $value) { goto YjAc7; HAzpo: z7RDe: goto WK21l; UpmP8: $spec_str = $spec_str . "\x2c" . $spec_array["\x73\160\x65\x63\137\x6e\x61\155\x65"]; goto HAzpo; YjAc7: $spec_array = $spec->getInfo(["\x73\160\145\x63\x5f\151\144" => $value], "\x73\160\145\143\137\x6e\141\155\145", ''); goto UpmP8; WK21l: } goto ZOn3V; IsG8B: $spec_str = substr($spec_str, 1); goto Mq0XH; lfYr9: } goto KWWE4; Imrsu: $attribute = new GoodsAttrModule(); goto bvJWv; GoVmS: if (empty($list)) { goto uFcT3; } goto N0iG8; KWWE4: NbxJG: goto YfqXF; eJ9sj: $spec = new GoodsSpec(); goto wVEMd; m1MT5: O3V5O: goto DL8JN; YfqXF: uFcT3: goto we3N4; bvJWv: $attribute_value = new GoodsAttrValue(); goto eJ9sj; N0iG8: foreach ($list as $k => $v) { goto rCKSm; O56yQ: $value_str = substr($value_str, 1); goto VN0Hn; eChjs: xYRH7: goto O56yQ; rCKSm: $attr_value_array = explode("\54", $v["\141\164\x74\162\137\x76\141\x6c\x75\x65\137\151\144"]); goto qH4mJ; pKVFW: Lxaam: goto x98ji; qH4mJ: $value_str = ''; goto qO5g7; qO5g7: foreach ($attr_value_array as $kn => $vn) { goto nDstp; nDstp: $attr_array = $attribute_value->getInfo(["\x61\164\x74\x72\x5f\x76\141\x6c\x75\145\x5f\151\144" => $vn], "\141\x74\164\162\x5f\166\141\154\165\145\137\x6e\141\155\145", ''); goto jEgmo; WD3Ap: d8xtJ: goto VUXU2; jEgmo: $value_str = $value_str . "\54" . $attr_array["\x61\164\x74\x72\x5f\166\141\154\x75\x65\137\156\x61\155\145"]; goto WD3Ap; VUXU2: } goto eChjs; VN0Hn: $list[$k]["\166\141\154\x75\145\137\x73\164\x72"] = $value_str; goto pKVFW; x98ji: } goto m1MT5; wVEMd: $list = $attribute->getPageLisy($condition, $search_text, $order = ''); goto GoVmS; we3N4: return $list; goto xiwX0; xiwX0: } public function getAttributeServiceDetail($attr_id, $condition = '') { goto eTmgf; rUKzS: $info = $attribute->get($attr_id); goto XVw4a; eTmgf: $attribute = new GoodsAttrValue(); goto rUKzS; XVw4a: $exp = explode("\x2c", $info["\x76\141\x6c\x75\x65"]); goto r_4DD; r_4DD: $info["\145\x78\x70"] = $exp; goto E90x4; E90x4: return $info; goto YoDL6; YoDL6: } public function deleteAttributeValueService($attr_id, $attr_value_id) { goto csiO8; ZTQ03: if ($result == 1) { goto yiY3r; } goto uX3p1; Q00XR: return -2; goto DtDvP; ec9s0: goto OViXz; goto zkvKy; csiO8: $attribute_value = new GoodsAttrValue(); goto hXYSb; hXYSb: $result = $this->getGoodsAttrValueCount(["\141\164\164\162\x5f\x69\x64" => $attr_id]); goto ZTQ03; DtDvP: OViXz: goto cHBK1; uX3p1: return $attribute_value->destroy($attr_value_id); goto ec9s0; zkvKy: yiY3r: goto Q00XR; cHBK1: } public function deleteAttributeService($attr_id) { goto dsb7M; Q7x0H: $res = $attribute_value->destroy(["\141\164\x74\x72\137\166\141\x6c\165\x65\x5f\x69\x64" => $attr_id]); goto yGubc; yGubc: return $res; goto qKyRh; dsb7M: $attribute_value = new GoodsAttrValue(); goto Q7x0H; qKyRh: } public function getGoodsAttrValueCount($condition) { goto R22Wk; D8q7Q: return $count; goto fCFhE; R22Wk: $attr_value = new GoodsAttrValue(); goto IK6sp; IK6sp: $count = $attr_value->where($condition)->count(); goto D8q7Q; fCFhE: } public function getAttributeValueServiceList($condition = '', $field = "\x2a", $order = '') { $attribute_value = new GoodsAttrValue(); return $attribute_value->getQuerys($condition, $field, $order); } public function getAttributeInfo($condition) { goto mB2eM; lx3af: return $info; goto VWsBG; RzxbM: $info = $attribute->getInfo($condition, "\x2a"); goto lx3af; mB2eM: $attribute = new GoodsAttrModule(); goto RzxbM; VWsBG: } public function getSpecInfo($condition) { goto jIhAC; vILQw: return $info; goto KUD8Z; jIhAC: $attribute = new GoodsSpecValue(); goto qpS4U; qpS4U: $info = $attribute->getInfo($condition, "\52"); goto vILQw; KUD8Z: } public function getGoodsSpecQuery($condition) { goto P2jOB; R1zWr: $goods_spec_query = $goods_spec->getQuerys($condition, "\x2a", "\163\x6f\x72\164"); goto d_b8F; P2jOB: $goods_spec = new GoodsSpec(); goto R1zWr; B8nHD: return $goods_spec_query; goto YkZGQ; oOuzp: O4Ig7: goto B8nHD; d_b8F: foreach ($goods_spec_query as $k => $v) { goto ev3de; WLaa2: $goods_spec_query[$k]["\166\x61\x6c\165\x65\x73"] = $goods_spec_value_query; goto UxnSz; ev3de: $goods_spec_value = new GoodsSpecValue(); goto hiSpa; hiSpa: $goods_spec_value_query = $goods_spec_value->getQuerys(["\x73\x70\x65\x63\x5f\x69\144" => $v["\163\160\145\143\137\151\x64"]], "\x2a", ''); goto WLaa2; UxnSz: J3Bib: goto DIml6; DIml6: } goto oOuzp; YkZGQ: } public function addGoodsSpecValue($spec_id, $spec_value, $sort = 0) { goto ZOBiL; culBU: $data = array("\163\x70\145\143\x5f\151\144" => $spec_id, "\163\x70\x65\143\137\166\x61\x6c\x75\145\x5f\156\x61\x6d\x65" => $spec_value, "\x73\x6f\x72\x74" => $sort, "\x63\x72\x65\141\164\x65\x5f\164\x69\x6d\145" => time()); goto HdNTg; ZSRJw: goto kMohL; goto KbSdV; KbSdV: XlLW6: goto fM2Mh; ZOBiL: $spec_value_model = new GoodsSpecValue(); goto culBU; fM2Mh: return $find_id["\x73\160\x65\143\137\x76\x61\154\x75\145\x5f\x69\144"]; goto oWLM5; Xn_Cv: return $spec_value_model->spec_value_id; goto ZSRJw; oWLM5: kMohL: goto NMlG2; BnY3t: $res = $spec_value_model->save($data); goto Xn_Cv; mONrs: if (!empty($find_id)) { goto XlLW6; } goto BnY3t; HdNTg: $find_id = $spec_value_model->get(["\163\160\x65\143\137\x76\141\154\x75\x65\x5f\156\x61\x6d\145" => $spec_value, "\163\160\x65\143\x5f\151\144" => $spec_id]); goto mONrs; NMlG2: } public function getGoodsAttrSpecQuery($condition) { goto vON23; NDp5U: $condition_spec["\x69\x73\x5f\166\151\163\x69\142\154\x65"] = 1; goto KCCoK; vON23: if (!($condition["\x61\x74\x74\x72\x5f\x69\144"] == 0)) { goto aT6nG; } goto op_n4; OrUy6: $goods_attribute = $this->getAttributeInfo($condition); goto y1peq; n0exM: $list["\141\164\x74\x72\x69\142\165\x74\x65\x5f\154\151\163\x74"] = $attribute_list; goto rSn_g; op_n4: return -1; goto narxt; y1peq: $condition_spec["\x73\x70\145\x63\137\x69\x64"] = array("\x69\x6e", $goods_attribute["\163\x70\x65\x63\x5f\151\144\137\x61\162\162\x61\171"]); goto NDp5U; bQLNC: foreach ($attribute_list as $k => $v) { goto Tj_Jp; xMRN9: cO3oH: goto pr7mP; Njhwe: $attribute_list[$k]["\166\x61\x6c\x75\x65\137\151\x74\x65\155\x73"] = $value_items; goto xMRN9; Tj_Jp: $value_items = explode("\54", $v["\166\141\154\x75\x65"]); goto Njhwe; pr7mP: } goto wv7kh; rSn_g: return $list; goto px41q; f1HVZ: $attribute_detail = $this->getAttributeServiceInfo($condition["\x61\164\164\x72\x5f\151\144"], ["\151\x73\x5f\x73\145\141\162\x63\150" => 1]); goto h7qNV; narxt: aT6nG: goto OrUy6; KCCoK: $spec_list = $this->getGoodsSpecQuery($condition_spec); goto f1HVZ; TLy7Q: $list["\163\x70\x65\143\137\x6c\151\x73\164"] = $spec_list; goto n0exM; wv7kh: ZKPbh: goto TLy7Q; h7qNV: $attribute_list = $attribute_detail["\x76\141\154\165\x65\x5f\154\151\x73\x74"]; goto bQLNC; px41q: } public function getAttributeServiceInfo($attr_id, $condition = '') { goto pWvKh; kz_GF: $condition = array(); goto zfl3Z; pWvKh: $attribute = new GoodsAttrModule(); goto Lm5Rm; rACRZ: obN3N: goto hgEC9; hgEC9: return $info; goto YZ7FM; fTPmy: $info["\x76\x61\154\x75\x65\137\154\x69\163\x74"] = $array; goto rACRZ; zfl3Z: if (empty($info)) { goto obN3N; } goto n4qnl; t4Dws: $array = array(); goto kz_GF; kL18F: $array = $this->getAttributeValueServiceList($condition, $field = "\x2a", $order = ''); goto fTPmy; Lm5Rm: $info = $attribute->get($attr_id); goto t4Dws; n4qnl: $condition["\141\x74\164\162\x5f\166\x61\x6c\165\145\x5f\151\x64"] = array("\x69\x6e", $info["\x61\164\164\162\x5f\x76\x61\154\x75\x65\137\x69\x64"]); goto kL18F; YZ7FM: } private function getGoodsCategoryId($category_id) { goto upsor; U5BCH: if (!($info["\154\x65\166\x65\x6c"] == 1)) { goto pvrJL; } goto mBCx4; mBCx4: return array($category_id, 0, 0); goto uJG0d; MzQAg: return array($info["\160\x69\144"], $category_id, 0); goto mzSIQ; ah2yy: if (!($info["\x6c\x65\x76\145\x6c"] == 3)) { goto rWqv3; } goto p_OVj; mzSIQ: oYmuz: goto ah2yy; XhqyA: if (!($info["\x6c\x65\166\x65\x6c"] == 2)) { goto oYmuz; } goto MzQAg; uJG0d: pvrJL: goto XhqyA; SvQsA: $info = $goods_category->get($category_id); goto U5BCH; upsor: $goods_category = new \app\common\model\GoodsCate(); goto SvQsA; RFiER: return array($info_parent["\x70\x69\x64"], $info["\160\x69\x64"], $category_id); goto sbv9c; p_OVj: $info_parent = $goods_category->get($info["\160\151\x64"]); goto RFiER; sbv9c: rWqv3: goto yRcTQ; yRcTQ: } public function addOrEditGoods($this_lib, $mch_id, $goods_id, $goods_name, $category_id, $supplier_id, $brand_id, $market_price, $price, $cost_price, $shipping_fee, $shipping_fee_id, $stock, $min_buy, $clicks, $sales, $picture, $keywords, $introduction, $description, $sort, $image_array, $sku_array, $state, $goods_attribute_id, $goods_attribute, $goods_spec_format, $sku_picture_values, $barcode, $weight) { goto uDISX; jjog3: try { goto LlKaV; Da9xx: $data_goods["\x73\x61\154\145\137\144\x61\164\x65"] = time(); goto Md90r; uKS77: $res = $this->goods->save($data_goods, ["\x67\x6f\157\144\x73\137\151\x64" => $goods_id]); goto cd2Fs; GCWKh: goto m4XCf; goto VF3pY; rrQND: $error = 1; goto aiy3H; fRe92: Qljnx: goto fAYAM; ZZCIf: if (!($this_lib == 1 && $goods_id != 0)) { goto kMAQ9; } goto n_24L; qHXcD: L1Cyd: goto egFVo; nWkS7: $goods_id = $this->goods->goods_id; goto RhJcq; RaYbW: if (!empty($sku_array)) { goto O7H5d; } goto ZLMrb; R2Na8: p1Vlh: goto oejJe; qeDj1: foreach ($sku_list_array as $k => $v) { goto EFKw4; SZdxv: $error = 1; goto n9Vyz; RcPOJ: s2j6Y: goto cQH2O; LycHA: if ($res) { goto IXDkM; } goto SZdxv; V7Cd_: $res = $this->addOrUpdateGoodsSkuItem($goods_id, $v, $img_ids, $sku_picture_array); goto LycHA; EFKw4: $img_ids = ''; goto SThPU; n9Vyz: IXDkM: goto RcPOJ; SThPU: foreach ($sku_imgs as $img_k => $img_v) { goto BAdd4; BAdd4: if (!strpos($v, $img_k)) { goto NyVBg; } goto zrRi_; ULrH1: NyVBg: goto aMUSw; aMUSw: MuW_T: goto nn8yd; Vz3cX: goto BEQEi; goto ULrH1; zrRi_: $img_ids = $img_v; goto Vz3cX; nn8yd: } goto GY2pE; GY2pE: BEQEi: goto V7Cd_; cQH2O: } goto kRvxJ; BcrCz: $sku_data = array("\x67\157\x6f\144\x73\137\151\144" => $goods_id, "\x73\x6b\165\137\x6e\141\x6d\145" => '', "\x6d\x61\x72\x6b\145\x74\137\x70\162\x69\143\145" => $market_price, "\160\162\151\143\145" => $price, "\x70\x72\x6f\155\x6f\164\x65\x5f\x70\x72\x69\143\x65" => $price, "\143\157\163\164\137\160\x72\151\x63\145" => $cost_price, "\x73\164\x6f\143\153" => $stock, "\151\155\141\147\x65\163" => 0, "\x63\162\145\x61\x74\145\137\x64\x61\x74\x65" => time()); goto j6PDq; VF3pY: fgFQs: goto bV7vg; RwX2K: $sku_list_array = explode("\302\xa7", $sku_array); goto z8L4D; q7hLq: $count = $goods_sku->getCount(["\x67\157\157\x64\x73\x5f\x69\x64" => $goods_id]); goto j_ssJ; z8L4D: $this->deleteSkuItem($goods_id, $sku_list_array); goto ClvRY; grHBk: $res = $goods_sku->save($sku_data); goto mWuhI; BKlLa: $data_goods["\x67\x6f\x6f\144\163\x5f\163\160\145\x63\x5f\x66\x6f\x72\155\141\x74"] = json_encode($spce, true); goto ZZCIf; FnqIc: $sku_list_array = explode("\302\xa7", $sku_array); goto XeTvM; nwemu: if ($res) { goto rvzNa; } goto rmSmG; hK4Um: $data_goods["\143\x72\145\x61\x74\x65\137\x74\151\155\x65"] = time(); goto Da9xx; pI22Q: $this->spec_format($goods_id, $spce); goto RaYbW; o09bj: if ($error == 0) { goto fgFQs; } goto rwqvN; mSMOa: if (!empty($sku_array)) { goto lT1Ry; } goto iNdwL; oejJe: QMayo: goto km8dL; aiy3H: UYyhg: goto BotwI; cd2Fs: $this->spec_format($goods_id, $spce); goto uPRXR; km8dL: if (!($goods_id > 0 && $this_lib == 0)) { goto BA69q; } goto qKB0b; BCf_U: $sku_picture_array = json_decode($sku_picture_values, true); goto UxnS2; XeTvM: foreach ($sku_list_array as $k => $v) { goto PAWzC; PMRwO: h8ePh: goto TUZwa; TUZwa: ptBPh: goto lxogs; SatmC: if ($res) { goto h8ePh; } goto Dn1gi; Dn1gi: $error = 1; goto PMRwO; AKiGV: $res = $this->addOrUpdateGoodsSkuItem($goods_id, $v, $img_ids, $sku_picture_array); goto SatmC; PAWzC: $img_ids = ''; goto kTXZN; lFXTH: FyifG: goto AKiGV; kTXZN: foreach ($sku_imgs as $img_k => $img_v) { goto OkGST; qKfew: y2nQi: goto CUP36; Zkaul: fM14u: goto qKfew; mNmol: $img_ids = $img_v; goto hMRQF; hMRQF: goto FyifG; goto Zkaul; OkGST: if (!strpos($v, $img_k)) { goto fM14u; } goto mNmol; CUP36: } goto lFXTH; lxogs: } goto kMeCw; Qs7p4: Hc7nr: goto vwrIV; rmSmG: $error = 1; goto UHazX; KWEVG: $sku_list_array = explode("\302\xa7", $sku_array); goto qeDj1; kMeCw: BOVzu: goto R2Na8; zBjoG: foreach ($spce as &$sku_item) { goto RHBv7; jDwdR: rIUPT: goto dI1Lg; dI1Lg: $sku_item["\x69\x73\155\x61\151\156"] = true; goto ejyP4; RHBv7: if ($sku_item["\x73\160\145\143\x5f\151\144"] == $ismain_id) { goto rIUPT; } goto V5JD8; akH24: jf1V0: goto H84Ji; V5JD8: unset($sku_item["\151\x73\155\x61\151\x6e"]); goto GEZyd; GEZyd: goto JA6Ij; goto jDwdR; ULHkZ: foreach ($sku_item["\166\x61\x6c\165\145"] as &$sku_value) { goto SYbWW; z8X1I: xVhTf: goto mKZkz; mKZkz: iqVfd: goto I1R9p; YL3T9: CmNb4: goto gkV6M; nc9bH: unset($sku_value["\151\x6d\x61\x67\145\163"]); goto MSnO1; MSnO1: goto xVhTf; goto YL3T9; SYbWW: $sk = $sku_value["\163\160\x65\x63\137\151\x64"] . "\x3a" . $sku_value["\x73\160\145\143\137\x76\141\x6c\165\x65\x5f\151\x64"]; goto bL4PN; bL4PN: if (isset($sku_imgs[$sk])) { goto CmNb4; } goto nc9bH; gkV6M: $sku_value["\151\x6d\x61\147\x65\x73"] = $sku_imgs[$sk]; goto z8X1I; I1R9p: } goto B0n1S; B0n1S: PifNZ: goto akH24; ejyP4: JA6Ij: goto ULHkZ; H84Ji: } goto TNcmQ; LlKaV: $data_goods = array("\x67\157\x6f\144\x73\137\156\141\x6d\145" => $goods_name, "\143\x61\164\145\137\151\144" => $category_id, "\x73\x75\x70\160\154\x69\x65\162\x5f\x69\144" => $supplier_id, "\142\162\x61\156\144\x5f\151\144" => $brand_id, "\x6d\141\162\153\145\x74\137\x70\x72\x69\143\x65" => $market_price, "\160\x72\151\x63\x65" => $price, "\x70\x72\x6f\x6d\x6f\x74\x69\x6f\156\x5f\160\x72\x69\x63\145" => $price, "\143\x6f\163\164\x5f\x70\x72\151\x63\x65" => $cost_price, "\163\x68\151\160\160\151\156\x67\137\x66\x65\145" => $shipping_fee, "\x73\150\x69\x70\160\151\x6e\x67\x5f\x66\145\145\137\x69\144" => $shipping_fee_id, "\x73\164\157\x63\153" => $stock, "\155\x69\156\137\142\165\x79" => $min_buy, "\x63\154\x69\x63\153\163" => $clicks, "\163\141\x6c\145\x73" => $sales, "\x6b\145\x79\167\x6f\x72\x64\x73" => $keywords, "\151\x6e\x74\162\157\144\x75\143\x74\x69\157\156" => $introduction, "\x64\145\163\x63\162\151\x70\x74\x69\x6f\x6e" => $description, "\x73\x6f\162\164" => $sort, "\x69\x6d\141\147\x65\163" => $picture, "\x69\155\x67\137\151\144\137\x61\162\x72\141\x79" => $image_array, "\163\x74\141\164\145" => $state, "\147\x6f\x6f\x64\163\137\141\164\164\x72\x69\x62\165\164\x65\x5f\151\x64" => $goods_attribute_id, "\x67\x6f\x6f\x64\x73\x5f\x61\x74\164\162\x69\x62\x75\164\x65" => $goods_attribute, "\x67\157\157\144\163\137\x73\160\x65\x63\x5f\146\157\162\x6d\141\164" => $goods_spec_format, "\155\x63\x68\137\151\x64" => $mch_id, "\142\141\x72\x63\x6f\144\145" => $barcode, "\x77\145\x69\x67\150\164" => $weight); goto zUt5T; OC088: $sku_imgs = array(); goto heAOr; IIXXM: $goods_sku = new GoodsSku(); goto q7hLq; iNdwL: $goods_sku = new GoodsSku(); goto Yqjua; UHazX: rvzNa: goto TctUt; vwrIV: $retval = $goods_sku->destroy(["\x67\157\x6f\x64\x73\x5f\151\x64" => $goods_id, "\x61\164\164\162\137\x76\141\154\165\x65\137\151\x74\145\x6d\163" => array("\x4e\105\x51", '')]); goto PjE6u; qKB0b: $data_goods["\165\x70\144\141\x74\x65\137\x74\x69\x6d\145"] = time(); goto uKS77; kRvxJ: xtzIp: goto fRe92; Jmwo6: lT1Ry: goto FnqIc; iXywi: goto XGw71; goto Qs7p4; ClvRY: foreach ($sku_list_array as $k => $v) { goto OQab1; MuwAy: if ($res) { goto KwVRJ; } goto Ncncq; OQab1: $img_ids = ''; goto JUzzo; Ncncq: $error = 1; goto IXtpj; JUzzo: foreach ($sku_imgs as $img_k => $img_v) { goto iS1eW; VcHIr: IUVp8: goto wPyAq; iS1eW: if (!strpos($v, $img_k)) { goto x7anX; } goto OAx6n; g6tRl: x7anX: goto VcHIr; OAx6n: $img_ids = $img_v; goto Vh_V4; Vh_V4: goto p05m0; goto g6tRl; wPyAq: } goto IPr24; IPr24: p05m0: goto nu5bs; IXtpj: KwVRJ: goto qHINW; nu5bs: $res = $this->addOrUpdateGoodsSkuItem($goods_id, $v, $img_ids, $sku_picture_array); goto MuwAy; qHINW: m5AjZ: goto VW9gL; VW9gL: } goto tqN7R; RVrE6: o7VWH: goto zBjoG; nF0Mo: XGw71: goto vBZHs; ea5fX: NwfAk: goto RwX2K; bV7vg: $this->goods->commit(); goto KOGL3; rwqvN: $this->goods->rollback(); goto L4Z2z; Yqjua: $sku_data = array("\x67\157\157\x64\163\x5f\151\x64" => $goods_id, "\x73\153\x75\x5f\x6e\141\155\145" => '', "\155\x61\162\153\x65\164\x5f\160\x72\151\x63\x65" => $market_price, "\160\162\151\143\x65" => $price, "\160\162\x6f\155\x6f\x74\145\137\160\x72\x69\143\x65" => $price, "\x63\157\x73\164\x5f\x70\162\151\x63\145" => $cost_price, "\163\164\157\143\153" => $stock, "\151\155\141\x67\145\x73" => 0, "\x63\162\x65\x61\x74\145\137\x64\x61\x74\x65" => time()); goto grHBk; vBZHs: goto L1Cyd; goto ea5fX; TsfFi: $goods_id = $this->goods->goods_id; goto pI22Q; TNcmQ: KDf_E: goto BKlLa; heAOr: foreach ($sku_picture_array as $sku_img) { goto jUfPA; uMjL6: RSeYw: goto KENIg; bgV3q: $sku_imgs[$img_k] = $sku_img["\151\155\x67\137\151\x64\x73"]; goto uMjL6; IQPPZ: $img_k = $sku_img["\x73\x70\x65\x63\137\x69\x64"] . "\x3a" . $sku_img["\x73\160\x65\x63\137\166\141\154\165\x65\137\x69\144"]; goto bgV3q; jUfPA: $ismain_id = $sku_img["\163\160\x65\x63\137\x69\144"]; goto IQPPZ; KENIg: } goto RVrE6; uPRXR: if (!empty($sku_array)) { goto NwfAk; } goto n7VdX; j6PDq: $res = $goods_sku->save($sku_data); goto nwemu; egFVo: BA69q: goto o09bj; QhPI3: O7H5d: goto KWEVG; tqN7R: vd8gO: goto qHXcD; Md90r: $this->goods->save($data_goods); goto nWkS7; biL4L: if (!($this_lib == 1 && $goods_id == 0)) { goto QMayo; } goto hK4Um; zUt5T: $spce = json_decode($goods_spec_format, true); goto BCf_U; n_24L: $data_goods["\x63\162\x65\x61\x74\145\137\164\x69\x6d\145"] = time(); goto H0XB2; UxnS2: $ismain_id = ''; goto OC088; n7VdX: $sku_data = array("\147\x6f\157\144\163\x5f\151\x64" => $goods_id, "\x73\x6b\x75\x5f\156\141\155\x65" => '', "\x6d\141\x72\153\145\164\137\160\162\x69\143\x65" => $market_price, "\160\x72\x69\143\145" => $price, "\160\162\157\155\x6f\164\145\x5f\160\x72\151\x63\x65" => $price, "\x63\x6f\163\164\137\160\x72\x69\x63\145" => $cost_price, "\x73\x74\157\x63\x6b" => $stock, "\x69\x6d\141\x67\x65\163" => 0, "\165\160\144\141\164\145\x5f\x64\x61\x74\145" => time()); goto IIXXM; VP0Yp: m4XCf: goto xQOFg; L4Z2z: return 0; goto GCWKh; m8t1F: $this->goods->save($data_goods); goto TsfFi; TctUt: goto Qljnx; goto QhPI3; RhJcq: $this->spec_format($goods_id, $spce); goto mSMOa; PjE6u: $res = $goods_sku->save($sku_data, ["\x67\157\157\144\163\x5f\x69\x64" => $goods_id]); goto nF0Mo; ZLMrb: $goods_sku = new GoodsSku(); goto BcrCz; KOGL3: return $goods_id; goto VP0Yp; mWuhI: if ($res) { goto UYyhg; } goto rrQND; H0XB2: $data_goods["\x73\x61\154\x65\137\x64\141\164\145"] = time(); goto m8t1F; j_ssJ: if ($count > 0) { goto Hc7nr; } goto V20mz; BotwI: goto p1Vlh; goto Jmwo6; fAYAM: kMAQ9: goto biL4L; V20mz: $res = $goods_sku->save($sku_data); goto iXywi; xQOFg: } catch (\Exception $e) { $this->goods->rollback(); return $e->getMessage(); } goto yg4wt; EhWll: $this->goods->startTrans(); goto jjog3; uDISX: $error = 0; goto EhWll; yg4wt: } public function spec_format($goods_id, $spec_list) { foreach ($spec_list as $k => $v) { goto geKeN; vqJ05: I52cv: goto aSEIz; aSEIz: lbC79: goto qHa5P; geKeN: foreach ($v["\166\x61\154\x75\145"] as $x => $y) { goto I8eDN; I8eDN: $sku_form = new GoodsSpecFormat(); goto d4zs2; d4zs2: $data = array("\x67\x6f\157\x64\x73\x5f\x69\x64" => $goods_id, "\163\x70\x65\x63\137\x76\x61\154\165\145\x5f\x6e\x61\155\145" => $y["\x73\x70\x65\x63\x5f\x76\x61\154\x75\145\x5f\156\x61\x6d\145"], "\163\160\x65\143\137\156\141\x6d\145" => $y["\163\160\145\143\137\x6e\x61\x6d\145"], "\163\x70\x65\143\137\x69\x64" => $y["\163\160\x65\x63\x5f\151\144"], "\163\160\145\x63\x5f\x76\x61\154\x75\x65\x5f\151\x64" => $y["\x73\160\x65\x63\x5f\x76\141\154\165\x65\x5f\151\x64"]); goto VbGbv; MSsgt: goto E8jJp; goto uY8XD; VbGbv: $check = Db::name("\171\x62\163\x63\x5f\147\157\x6f\x64\163\x5f\x73\160\145\143\137\146\x6f\162\155\141\x74")->where($data)->find(); goto qTj47; VUATV: rGnZ0: goto ujwnF; MmBUp: $sku_form->save($data, ["\151\x64" => $check["\x69\x64"]]); goto kEMSl; uY8XD: F0ngV: goto MmBUp; qTj47: if ($check) { goto F0ngV; } goto sZjuI; kEMSl: E8jJp: goto VUATV; sZjuI: $sku_form->save($data); goto MSsgt; ujwnF: } goto vqJ05; qHa5P: } ldhk3: } private function deleteSkuItem($goods_id, $sku_list_array) { goto zUrwq; ge7j6: x5fr3: goto YBA22; uOyv7: if (empty($list)) { goto zw7d3; } goto DIJ4P; aPatV: $list = $goods_sku->where("\x67\x6f\157\x64\x73\137\151\144\x3d" . $goods_id)->select(); goto uOyv7; DIJ4P: foreach ($list as $k => $v) { goto PmRn2; WXQQw: $goods_sku->destroy($v["\163\x6b\x75\137\151\x64"]); goto JkbnP; WgJHv: WcbU9: goto cA057; JkbnP: bMsd_: goto WgJHv; PmRn2: if (in_array($v["\141\x74\x74\x72\x5f\x76\x61\x6c\165\145\137\x69\164\x65\x6d\163"], $sku_item_list_array)) { goto bMsd_; } goto WXQQw; cA057: } goto L9RpL; k8euE: zw7d3: goto CdGZj; L9RpL: e09_B: goto k8euE; YBA22: $goods_sku = new GoodsSku(); goto aPatV; G0a_0: foreach ($sku_list_array as $k => $sku_item_array) { goto qbaSQ; bo6db: xAkFz: goto NQ9hh; sw9bW: $sku_item_list_array[] = $sku_item[0]; goto bo6db; qbaSQ: $sku_item = explode("\302\246", $sku_item_array); goto sw9bW; NQ9hh: } goto ge7j6; zUrwq: $sku_item_list_array = array(); goto G0a_0; CdGZj: } public function addGoodsSkuPicture($goods_id, $sku_img_array) { goto abBqs; abBqs: $goods_sku_picture = new GoodsSku(); goto WRS2P; PyXlb: $retval = $goods_sku_picture->save($data); goto LKjD0; WRS2P: $data = array("\147\x6f\x6f\x64\163\137\151\144" => $goods_id, "\x69\155\141\x67\145\163" => $sku_img_array); goto PyXlb; LKjD0: return $retval; goto F9TyV; F9TyV: } private function addOrUpdateGoodsSkuItem($goods_id, $sku_item_array, $img_ids, $img_arr) { goto M5v3a; BYbb7: $aa = explode("\73", $sku_item[0]); goto zaj6_; eWxuG: VBAbB: goto tAv_Z; DmfNO: if (empty($sku_count)) { goto rmm_P; } goto oZsOM; ev7Uy: rmm_P: goto oqb4Z; M5v3a: $sku_item = explode("\302\246", $sku_item_array); goto tD3kf; BwAKy: $goods_sku->save($data); goto Asgca; oZsOM: $data = array("\x67\157\x6f\144\163\137\x69\x64" => $goods_id, "\163\153\165\x5f\x6e\x61\155\x65" => $sku_name, "\x70\162\x69\x63\145" => $sku_item[1], "\x70\162\157\x6d\157\x74\x65\137\160\x72\151\x63\145" => $sku_item[1], "\155\x61\x72\153\145\164\137\160\162\x69\143\145" => $sku_item[2], "\x63\157\x73\164\x5f\160\x72\151\x63\145" => $sku_item[3], "\x73\x74\157\143\x6b" => $sku_item[4], "\x69\155\x61\x67\145\163" => $img_ids, "\165\160\x64\x61\164\145\137\144\x61\164\145" => time()); goto s6Ka6; zwOxP: JetqK: goto eWxuG; dOnNv: if (!(!empty($sku_item[0]) && !empty($img_arr))) { goto Eb8S7; } goto BYbb7; tD3kf: $goods_sku = new GoodsSku(); goto OBZAi; zaj6_: if (!$aa) { goto VBAbB; } goto PsZZH; rSX8W: goto WjJTH; goto ev7Uy; PsZZH: foreach ($aa as $k => $v) { goto NYdOU; PdQq2: muTmz: goto KNulB; jzipW: $img_ids = $img_arr[$i]["\x69\155\x67\137\151\x64\163"]; goto LQBNs; Td0iT: fDGBi: goto MQWKh; AzEtL: goto muTmz; goto Td0iT; e9hEG: $i = 0; goto PdQq2; vua1E: if (!($img_arr[$i]["\x73\160\145\x63\137\151\144"] == $v[0] && $img_arr[$i]["\163\x70\x65\x63\137\166\141\154\x75\x65\137\x69\144"] == $v[1])) { goto akAgc; } goto jzipW; UbJQe: H7d64: goto lkpW_; MQWKh: eJt4p: goto USUQH; lkpW_: $i++; goto AzEtL; LQBNs: akAgc: goto UbJQe; NYdOU: $v = explode("\72", $v); goto e9hEG; KNulB: if (!($i < count($img_arr))) { goto fDGBi; } goto vua1E; USUQH: } goto zwOxP; tAv_Z: Eb8S7: goto pzmL6; oqb4Z: $data = array("\x67\x6f\x6f\144\x73\x5f\151\x64" => $goods_id, "\x73\x6b\x75\137\156\x61\x6d\145" => $sku_name, "\x61\164\164\162\x5f\166\x61\x6c\x75\145\x5f\x69\x74\145\x6d\x73" => $sku_item[0], "\160\162\151\143\x65" => $sku_item[1], "\160\162\157\155\x6f\164\x65\137\160\162\151\x63\x65" => $sku_item[1], "\155\x61\162\x6b\x65\164\x5f\x70\162\x69\143\145" => $sku_item[2], "\143\157\163\164\137\160\162\151\143\x65" => $sku_item[3], "\163\164\157\x63\x6b" => $sku_item[4], "\151\155\141\x67\x65\x73" => $img_ids, "\x63\162\145\141\x74\x65\x5f\144\141\x74\x65" => time()); goto BwAKy; OBZAi: $sku_name = $this->createSkuName($sku_item[0]); goto vkN9s; pzmL6: $sku_count = $goods_sku->where($condition)->find(); goto DmfNO; s6Ka6: $res = $goods_sku->save($data, ["\x73\x6b\165\x5f\151\144" => $sku_count["\x73\153\x75\x5f\151\144"]]); goto bvhQ0; bvhQ0: return $res; goto rSX8W; vkN9s: $condition = array("\147\157\x6f\144\x73\x5f\151\144" => $goods_id, "\x61\164\x74\x72\x5f\166\141\154\165\145\137\151\x74\x65\155\x73" => $sku_item[0]); goto dOnNv; Asgca: return $goods_sku->sku_id; goto mGDGv; mGDGv: WjJTH: goto Jl8UB; Jl8UB: } private function createSkuName($pvs) { goto pFSsM; Hn_fT: return $name; goto O1Bst; pFSsM: $name = ''; goto AcCBW; u0D8y: rzBFB: goto Hn_fT; QplpM: foreach ($pvs_array as $k => $v) { goto BauEF; SJzzl: $goods_spec_value_model = new GoodsSpecValue(); goto uLV8Z; uLV8Z: $value_name = $goods_spec_value_model->getInfo(["\163\160\x65\143\x5f\x76\x61\x6c\165\x65\x5f\x69\144" => $prop_value], "\x73\x70\x65\143\137\x76\141\x6c\165\x65\137\156\141\155\x65"); goto FWJ5B; BauEF: $value = explode("\x3a", $v); goto ieShO; rnHE_: HWbyj: goto oUYaH; LojgV: $prop_value = $value[1]; goto SJzzl; ieShO: $prop_id = $value[0]; goto LojgV; FWJ5B: $name = $name . $value_name["\x73\x70\x65\143\x5f\x76\x61\x6c\165\145\x5f\x6e\x61\155\145"] . "\x20"; goto rnHE_; oUYaH: } goto u0D8y; AcCBW: $pvs_array = explode("\73", $pvs); goto QplpM; O1Bst: } public function regainGoodsDeleted($goods_ids) { $this->goods->startTrans(); try { goto w49F3; sW3h2: $this->goods->commit(); goto mPsDB; w49F3: $data = array("\x69\163\137\144\x65\x6c" => 0, "\165\x70\x64\141\164\x65\137\164\151\x6d\145" => time()); goto asUoq; asUoq: $result = $this->goods->save($data, "\147\x6f\x6f\144\x73\x5f\151\144\x20\x20\x69\156\x28{$goods_ids}\x29"); goto sW3h2; mPsDB: return SUCCESS; goto yaAq4; yaAq4: } catch (\Exception $e) { $this->goods->rollback(); return UPDATA_FAIL; } } public function deleteRecycleGoods($goods_id) { goto WKQtC; WKQtC: $goods_delete = new \app\common\model\Goods(); goto w13R5; w13R5: $goods_delete->startTrans(); goto JjH7Y; JjH7Y: try { goto IGUhU; CX__T: foreach ($goods_id_array as $k => $v) { goto X4xax; T2mmq: sjcSV: goto wWFu3; EEiHc: $goods_attribute_model->where("\147\157\157\144\x73\x5f\151\x64\x20\75\40{$v}")->delete(); goto T2mmq; X4xax: $goods_sku_model->where("\147\x6f\x6f\144\163\x5f\151\144\40\x3d\40{$v}")->delete(); goto EEiHc; wWFu3: } goto stcMH; stcMH: jid6z: goto COZxF; k6oDi: $goods_delete->commit(); goto IDx9O; oLY9K: GKM9V: goto cauON; MI5nM: $goods_id_array = explode("\54", $goods_id); goto dSVni; cauON: return SUCCESS; goto Iv1Fy; COZxF: KW6Kn: goto k6oDi; Iv1Fy: G60Ei: goto ou9T2; Z0v8r: $goods_attribute_model = new GoodsAttr(); goto CX__T; IGUhU: $res = $goods_delete->where("\147\x6f\157\x64\163\137\x69\144\40\x69\x6e\40\x28{$goods_id}\51\40")->delete(); goto dpiWk; v9lNj: goto G60Ei; goto oLY9K; dSVni: $goods_sku_model = new GoodsSku(); goto Z0v8r; dpiWk: if (!($res > 0)) { goto KW6Kn; } goto MI5nM; IDx9O: if ($res > 0) { goto GKM9V; } goto cF31y; cF31y: return DELETE_FAIL; goto v9lNj; ou9T2: } catch (\Exception $e) { $goods_delete->rollback(); return DELETE_FAIL; } goto ccUeE; ccUeE: } public function getGoodsDetail($goods_id) { goto yLZTS; imphF: if (empty($spec_list)) { goto yF3xf; } goto qRuMN; IIFbS: $num = $orderGoods->getSum(["\x67\x6f\157\144\163\137\x69\144" => $goods_id], "\x6e\165\x6d"); goto H6N0O; gqprg: $attribute_model = new GoodsAttrModule(); goto CzCWc; OCO09: $goods_sku_detail = $goods_sku->where("\147\157\157\144\163\x5f\x69\144\x3d" . $goods_id)->select(); goto FKA7G; QnRmY: $goods_picture = $goods_img->get($goods_detail["\151\155\141\x67\x65\163"]); goto jjnEi; mucph: $goods_detail = $goods->get($goods_id); goto pK0Nf; QxXc8: foreach ($img_array as $k => $v) { goto C5OYL; pCbR2: XZ1Cg: goto vM1GT; Hc34v: tpaeE: goto pCbR2; HD89S: foreach ($goods_img_list as $t => $m) { goto wVVIx; Vt7XF: hSAGL: goto Jwsoo; Xs62T: N42Ug: goto Vt7XF; wVVIx: if (!($m["\151\x6d\x67\137\x69\144"] == $v)) { goto N42Ug; } goto yZHdd; yZHdd: $img_temp_array[] = $m; goto Xs62T; Jwsoo: } goto Hc34v; C5OYL: if (empty($goods_img_list)) { goto XZ1Cg; } goto HD89S; vM1GT: bLr6X: goto cXFv0; cXFv0: } goto Rm5Lj; YYblt: $goods_attribute_model = new GoodsAttr(); goto E8aku; KU2Fx: $goos_sku_picture_query = $goods_sku->getQuerys(["\x67\x6f\157\144\163\137\151\x64" => $goods_id], "\151\155\x61\147\x65\x73\x2c\x61\x74\x74\162\x5f\x76\141\154\165\x65\137\151\164\145\x6d\x73", ''); goto ay13b; tJySL: $goods_detail["\163\x70\x65\143\137\154\x69\x73\164"] = $spec_list; goto AUtJy; H6N0O: $goods_detail["\160\165\x72\143\150\141\163\x65\137\x6e\x75\x6d"] = $num; goto xsAat; qRuMN: foreach ($spec_list as $k => $v) { goto ufeGh; ufeGh: foreach ($v["\166\141\x6c\x75\x65"] as $m => $t) { goto vlh8Y; J6IxR: xcde3: goto KeYwi; vlh8Y: if (!empty($t["\163\160\145\143\x5f\163\x68\x6f\167\137\x74\x79\160\145"])) { goto xcde3; } goto tkU9H; tkU9H: $spec_list[$k]["\x76\x61\154\165\145"][$m]["\163\160\145\x63\137\x73\150\157\167\137\164\x79\x70\145"] = 1; goto J6IxR; KeYwi: cyrmA: goto sBGVg; sBGVg: } goto U22FH; hY5dx: sBpu5: goto cy3g_; U22FH: eMfQz: goto hY5dx; cy3g_: } goto TERGD; F6dRX: goto d78EA; goto TD6fC; FsdLk: inC1L: goto c1oLP; oSx0h: FyQn3: goto QnRmY; CzCWc: $attribute_info = $attribute_model->getInfo(["\x61\x74\164\162\x5f\x69\144" => $goods_detail["\147\x6f\x6f\144\x73\x5f\141\x74\x74\x72\151\x62\165\x74\x65\137\x69\x64"]], "\141\164\164\162\137\156\x61\x6d\145"); goto lQn1e; jjnEi: $goods_detail["\151\155\x67\137\x74\x65\x6d\x70\x5f\141\x72\x72\141\171"] = $img_temp_array; goto r7FhY; FKA7G: foreach ($goods_sku_detail as $k => $goods_sku) { $goods_sku_detail[$k]["\x6d\145\x6d\142\x65\x72\x5f\160\162\x69\x63\145"] = $goods_sku["\x70\162\x69\143\x65"]; Fq5Oz: } goto oGTvh; WwdOO: $goods_sku = new GoodsSku(); goto OCO09; Rm5Lj: GBl6F: goto oSx0h; Hr9IQ: $order = "\151\x6e\x73\x74\x72\x28\47\54" . $goods_detail["\x69\155\147\x5f\151\144\137\141\x72\162\141\171"] . "\x2c\47\x2c\103\117\x4e\103\x41\124\50\47\54\47\54\151\x6d\147\x5f\x69\x64\x2c\47\54\47\x29\51"; goto bt1Pg; UGs7L: wmVid: goto WwdOO; AUtJy: $goods_img = new \app\common\model\Images(); goto Hr9IQ; lQn1e: $goods_detail["\147\x6f\x6f\144\x73\x5f\141\164\x74\x72\151\x62\x75\164\x65\x5f\x6e\141\x6d\x65"] = $attribute_info["\141\x74\164\x72\137\x6e\141\x6d\145"]; goto YYblt; xhLC6: $goods_detail["\x63\x61\x74\x65\137\156\141\x6d\145"] = $category_name; goto TayNB; ay13b: $album_picture = new \app\common\model\Images(); goto AfMiC; TayNB: if ($goods_detail["\147\157\x6f\x64\x73\x5f\141\x74\164\162\151\x62\x75\164\x65\x5f\x69\144"] != 0) { goto LLcgc; } goto uISUp; sugnT: return null; goto UGs7L; Jdiky: yF3xf: goto tJySL; xVJ2i: $orderGoods = new \app\common\model\OrderGoods(); goto irdrJ; oGTvh: pl5zO: goto L82Xq; bsQ12: $goods_detail["\147\x6f\x6f\144\x73\137\141\164\164\x72\x69\142\165\x74\145\137\154\151\163\x74"] = array(); goto F6dRX; x_WcD: $goods_detail["\147\157\x6f\144\x73\x5f\x61\x74\x74\x72\x69\x62\x75\x74\145\x5f\x6c\151\x73\x74"] = $goods_attribute_list; goto jrjyI; AfMiC: foreach ($goos_sku_picture_query as $k => $v) { goto LnGyB; ZRdJi: unset($goos_sku_picture_query[$k]); goto p7G0s; l5z51: rZzDJ: goto dCFub; LnGyB: if ($v["\x69\155\141\147\145\163"] != "\x30") { goto nXfyi; } goto ZRdJi; OMSV7: $goos_sku_picture_query[$k]["\163\x6b\165\x5f\x70\151\143\x74\165\162\x65\137\161\165\145\x72\171"] = $tmp_img_array; goto l5z51; p7G0s: goto rZzDJ; goto tlng6; rjGbj: $tmp_img_array = $album_picture->getQuerys(["\151\155\147\x5f\151\x64" => $v["\x69\155\x61\x67\x65\163"]], "\x2a", ''); goto OMSV7; tlng6: nXfyi: goto rjGbj; dCFub: arGcB: goto kTfUW; kTfUW: } goto FsdLk; jrjyI: d78EA: goto KU2Fx; yGaKl: $img_array = explode("\x2c", $goods_detail["\151\x6d\147\137\151\x64\x5f\141\x72\x72\141\x79"]); goto QxXc8; E8aku: $goods_attribute_list = $goods_attribute_model->getQuerys(["\147\x6f\x6f\x64\163\x5f\x69\x64" => $goods_id], "\52", ''); goto x_WcD; TD6fC: LLcgc: goto gqprg; yLZTS: $goods = new \app\common\model\Goods(); goto mucph; irdrJ: $num = 0; goto IIFbS; TERGD: Ph_i3: goto Jdiky; LthE4: $goods_detail["\x70\x69\143\x74\165\x72\x65\137\x64\145\164\x61\151\x6c"] = $goods_picture; goto hx_Zt; uISUp: $goods_detail["\147\x6f\157\x64\163\x5f\141\164\164\162\151\142\165\164\x65\x5f\156\141\x6d\x65"] = ''; goto bsQ12; c1oLP: sort($goos_sku_picture_query); goto yfzsP; JnNDO: $img_temp_array = array(); goto blkaA; pK0Nf: if (!($goods_detail == null)) { goto wmVid; } goto sugnT; r7FhY: $goods_detail["\x69\155\x67\137\154\151\x73\164"] = $goods_img_list; goto LthE4; blkaA: if (!(trim($goods_detail["\x69\155\147\137\151\144\x5f\141\x72\162\141\171"]) != '')) { goto FyQn3; } goto yGaKl; yfzsP: $goods_detail["\x73\153\x75\137\160\x69\x63\x74\x75\x72\x65\137\141\162\162\141\x79"] = $goos_sku_picture_query; goto xVJ2i; hx_Zt: $category_name = $this->getGoodsCategoryName($goods_detail["\x63\x61\164\x65\137\x69\144"]); goto xhLC6; xsAat: return $goods_detail; goto l1_Au; bt1Pg: $goods_img_list = $goods_img->getQuerys(["\151\x6d\147\x5f\x69\144" => ["\151\x6e", $goods_detail["\151\x6d\147\137\151\144\137\x61\x72\162\x61\x79"]]], "\x2a", $order); goto JnNDO; L82Xq: $goods_detail["\163\153\x75\x5f\154\151\163\x74"] = $goods_sku_detail; goto yHhcY; yHhcY: $spec_list = json_decode($goods_detail["\x67\x6f\157\x64\163\137\x73\x70\145\143\x5f\x66\157\162\155\x61\164"], true); goto imphF; l1_Au: } private function getGoodsCategoryName($cate_id, $name = '') { goto amYg2; pqSTY: return $this->getGoodsCategoryName($cate_id, $name); goto t2cVU; QLh2x: YIxdd: goto myRmx; YBABJ: goto XwHDU; goto QLh2x; kQxcB: wJnXg: goto ynD0C; dnT9p: goto wJnXg; goto yvf12; CFi4s: $info = $goods_category->getInfo(["\143\141\164\145\137\x69\x64" => $cate_id], "\x63\x61\x74\145\x5f\x6e\141\155\145\54\x70\x69\x64"); goto NUD5v; exod9: if ($name == '') { goto vXxqF; } goto EYevl; fT7mg: $name .= $info["\143\141\x74\x65\x5f\156\x61\155\x65"]; goto kQxcB; OXN5c: if ($info["\x70\x69\144"] != 0) { goto YIxdd; } goto olscl; myRmx: $cate_id = $info["\x70\x69\144"]; goto pqSTY; amYg2: $goods_category = new \app\common\model\GoodsCate(); goto CFi4s; olscl: return $name; goto YBABJ; NUD5v: if (empty($info["\x63\x61\164\145\x5f\156\141\x6d\x65"])) { goto WO5xr; } goto exod9; EYevl: $name = $info["\143\x61\x74\x65\137\156\141\x6d\x65"] . "\x20\x3e\x20" . $name; goto dnT9p; t2cVU: XwHDU: goto dL0Lu; ynD0C: WO5xr: goto OXN5c; yvf12: vXxqF: goto fT7mg; dL0Lu: } public function ModifyGoodsRecommend($goods_ids, $re) { goto IkpUh; aBVWj: try { goto B2SJY; oJxvV: foreach ($goods_id_array as $k => $v) { goto nUHEK; qso_h: $goods->save($data, ["\x67\x6f\157\x64\163\137\x69\144" => $v]); goto zcqU6; zcqU6: URRmM: goto xpgil; nUHEK: $goods = new \app\common\model\Goods(); goto qso_h; xpgil: } goto QatZv; QatZv: oEQ9S: goto OX5mO; pMAxY: return 1; goto qZZCT; B2SJY: $goods_id_array = explode("\54", $goods_ids); goto x2OhO; x2OhO: $data = array("\151\x73\137\x68\x6f\164" => $re); goto oJxvV; OX5mO: $goods->commit(); goto pMAxY; qZZCT: } catch (\Exception $e) { $goods->rollback(); return $e->getMessage(); } goto EeuO7; mRv_5: $goods->startTrans(); goto aBVWj; IkpUh: $goods = new \app\common\model\Goods(); goto mRv_5; EeuO7: } public function ModifyGoodsRecommendNew($goods_ids, $new) { goto ji2KS; OWrAf: try { goto Sh1f1; kqKXt: return 1; goto BPpAo; Qe2JI: $goods->commit(); goto kqKXt; Sh1f1: $goods_id_array = explode("\54", $goods_ids); goto Dt3nC; Dt3nC: $data = array("\x69\x73\x5f\156\x65\167" => $new); goto aALtW; aALtW: foreach ($goods_id_array as $k => $v) { goto i1YJR; QM2NE: $goods->save($data, ["\147\x6f\x6f\x64\163\137\x69\x64" => $v]); goto HI57A; i1YJR: $goods = new \app\common\model\Goods(); goto QM2NE; HI57A: E1k8P: goto j0HAS; j0HAS: } goto Ltwby; Ltwby: M3Nnh: goto Qe2JI; BPpAo: } catch (\Exception $e) { $goods->rollback(); return $e->getMessage(); } goto evU33; FGczh: $goods->startTrans(); goto OWrAf; ji2KS: $goods = new \app\common\model\Goods(); goto FGczh; evU33: } public function ModifyGoodsRecommendTui($goods_ids, $new) { goto LBk5A; LBk5A: $goods = new \app\common\model\Goods(); goto pt_a9; I8uVz: try { goto zeSVq; V1hHs: foreach ($goods_id_array as $k => $v) { goto vh4yY; vh4yY: $goods = new \app\common\model\Goods(); goto RFFcW; RFFcW: $goods->save($data, ["\147\157\157\144\163\137\151\144" => $v]); goto vOcft; vOcft: mx5bt: goto e7v7e; e7v7e: } goto nAjks; bS1Tw: return 1; goto UDikO; zeSVq: $goods_id_array = explode("\x2c", $goods_ids); goto xX9Ak; t3Awe: $goods->commit(); goto bS1Tw; nAjks: TxKJY: goto t3Awe; xX9Ak: $data = array("\151\x73\x5f\162\145\143\x6f\x6d\155\x65\x6e\x64" => $new); goto V1hHs; UDikO: } catch (\Exception $e) { $goods->rollback(); return $e->getMessage(); } goto HHc7C; pt_a9: $goods->startTrans(); goto I8uVz; HHc7C: } public function attrModDel($mod_id) { goto dju8H; VBwzy: return $res; goto Hty3G; dju8H: $mod = new GoodsAttrModule(); goto oSyDd; oSyDd: $res = $mod->destroy(["\x61\164\x74\x72\137\x69\x64" => $mod_id]); goto VBwzy; Hty3G: } public function attrModIs_use($mod_id) { goto n5037; x3bhM: return $res; goto oLq77; n5037: $mod = new GoodsAttrModule(); goto ysBOJ; ysBOJ: $res = $mod->destroy(["\141\164\x74\162\137\x69\x64" => $mod_id]); goto x3bhM; oLq77: } public function attrModOff($mod_id) { goto z6B7n; z6B7n: $mod = new GoodsAttrModule(); goto ZaigG; ZaigG: $res = $mod->save(["\151\x73\x5f\x75\x73\145" => 0], ["\141\x74\164\x72\x5f\151\x64" => $mod_id]); goto BxXWy; BxXWy: return $res; goto GXUT4; GXUT4: } public function attrModOn($mod_id) { goto G10Dc; G10Dc: $mod = new GoodsAttrModule(); goto uMoi8; s9fcE: return $res; goto CJ5EH; uMoi8: $res = $mod->save(["\x69\163\137\165\x73\x65" => 1], ["\x61\x74\x74\162\x5f\x69\x64" => $mod_id]); goto s9fcE; CJ5EH: } public function editGoodsType($good_id, $key) { goto Hcpag; XmlVq: q7Eib: goto jlqbl; reDkJ: $res = $goods->save($data, ["\147\157\x6f\x64\163\x5f\x69\144" => $good_id]); goto vv0DB; QsVmI: $data = array("\151\x73\137\150\x6f\x74" => 0); goto Gi1RJ; j3wcO: $data = array("\151\x73\137\x72\x65\143\x6f\x6d\155\x65\x6e\x64" => 0); goto xEiBN; Hcpag: $goods = new \app\common\model\Goods(); goto oiV0K; m6ftc: if (!($key == "\164\x75\x69")) { goto eTcuN; } goto j3wcO; jlqbl: if (!($key == "\x68\x6f\164")) { goto Ffkds; } goto QsVmI; xEiBN: eTcuN: goto reDkJ; vv0DB: return $res; goto j5wPc; oiV0K: if (!($key == "\x6e\145\167")) { goto q7Eib; } goto DfP1W; DfP1W: $data = array("\x69\163\137\156\x65\x77" => 0); goto XmlVq; Gi1RJ: Ffkds: goto m6ftc; j5wPc: } }
